All Functions Used So Far, Week 7

theme_classic

{GGPLOT2}

A minimalistic theme with no gridlines

geom_jitter

{GGPLOT2}

Add randomly displaced points to reduce overplotting

list

{base}

Create a list object

table

{base}

Obtain frequency table of a variable/cross-tabulation of two variables

filter

{dplyr}

Filter out rows of a data frame according to logical vector

with

{base}

evaluate expression in the context of a data frame

subset

{base}

Return subsets of vectors, matrices or data frames which meet conditions.

summarise

{dplyr}

collapse the dataset to a summary statistic. Usually used with group_by()

cor.test

{stats}

Test for Association/Correlation Between Paired Samples

replace

{base}

Replace elements in a vector

xlab

{GGPLOT2}

Label the x axis (ggplot)

is.na

{base}

Check if a value is NA/elements of vector are NA

sum

{base}

Get sum of numeric values or a vector

factor

{base}

Create a factor

read.csv

{utils}

Read a csv file to data frame. Specify stringsAsFactors = FALSE to keep all string columns as characters

round

{base}

Rounds numbers

summary

{base}

Obtain summary statistics or detailed regression output

write.csv

{utils}

write a csv file to a data frame

lm

{stats}

Fit linear models using least squares

as.integer

{base}

Convert an object to integer values

sd

{stats}

Get standard deviation of a vector

scale_x_continuous

{GGPLOT2}

Customise continuous x axis

geom_vline

{GGPLOT2}

Draws a vertical line

read_excel

{readxl}

Read an Excel file

labs

{GGPLOT2}

Customise labels in GGPLOT2

ggsave

{GGPLOT2}

Save a ggplot to file

group_tt

{tinytable}

Grouping in tinytable

theme

{GGPLOT2}

Customize ggplot themes

geom_smooth

{GGPLOT2}

Generates a smoothed conditional means curve / line

factor

{base}

Create factor variables

library

{base}

Load an R package

complete.cases

{stats}

Find Complete Cases

mean

{base}

Get mean of a vector

recode

{dplyr}

Recode a variable

group_by

{dplyr}

Group tibble/data.frame by a factor variable. All further tidyverse operations are performed group-wise

geom_point

{GGPLOT2}

Generates a scatter plot

c

{base}

Combine values/vectors into a vector

ggtitle

{GGPLOT2}

Generates a title for a ggplot graph

element_line

{GGPLOT2}

Customise line appearance

mutate

{dplyr}

Create new variables

names

{base}

Get or set names of an object

matrix

{base}

Creates a matrix from the given set of values.

class

{base}

Retrieve class of an R object

chisq.test

{stats}

Chi-Squared test (e.g. for cross-tabulations)

prop.table

{base}

Transform frequency table into table of proportions

ggplot

{GGPLOT2}

Create a ggplot graph

setwd

{base}

Set Working Directory

save_tt

{tinytable}

Save a tinytable object to a file

margin

{GGPLOT2}

Set margins around plot elements (used inside theme elements)

pwr.r.test

{pwr}

Power analysis for correlation tests

vdem

{vdemdata}

V-Dem country-year dataset

datasummary

{modelsummary}

Create customizable summary-statistics tables

scale_y_continuous

{GGPLOT2}

Customise continuous y axis

cut

{base}

Convert Numeric to Factor

read_csv

{readr}

Read CSV files

correlation_matrix

{corrtable}

Create a formatted correlation matrix of variables

data.frame

{base}

Create a data.frame from vectors

dim

{base}

Get dimensions of a data frame

aes

{GGPLOT2}

Construct aesthetic mapping of a ggplot graph

as.numeric

{base}

Coerce a vector to numeric

element_blank

{GGPLOT2}

This theme element draws nothing, and assigns no space

element_text

{GGPLOT2}

Customise text in GGPLOT2

attach

{base}

Attach Set of R Objects to Search Path

save_plot

{cowplot}

Save a plot to a file

ylab

{GGPLOT2}

Label the y axis (ggplot)

geom_hline

{GGPLOT2}

Add a horizontal line in GGPLOT2

as.character

{base}

Coerce a vector to character

select

{dplyr}

Select columns from a tibble/data frame

modelsummary

{modelsummary}

Creates regression and data tables

confint

{stats}

Calculate confidence Intervals for Model Parameters

The end!